const Mock = require('mockjs')

// const data = Mock.mock({
//   'items|30': [{
//     id: '@id',
//     title: '@sentence(10, 20)',
//     'status|1': ['published', 'draft', 'deleted'],
//     author: 'name',
//     display_time: '@datetime',
//     pageviews: '@integer(300, 5000)'
//   }]
// })

const data = Mock.mock({
  'items|90': [{
    ID: '@increment',
    Vendor: '@word(5, 21)',
    Address: '@county(true)',
    'Status|1': ['occupied', 'available', 'disabled', 'expired'],
    InsIdCd: '@string("number", 8)',
    ApplyTime: '@datetime',
    ExpireDate: '@datetime',
    PosUid: '@guid',
    MerchantName: '@cword(3, 10)',
    MerchantZone: '@province',
    'MerchantType|1': ['Retail', 'Accommodation', 'Catering'],
    Description: '@cparagraph'
  }]
})

module.exports = [
  {
    url: '/pos_admin/pos/all',
    type: 'get',
    response: () => {
      const items = data.items
      return {
        Code: 20000,
        Data: {
          Total: items.length,
          Items: items
        }
      }
    }
  }
]
